home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Lib / qmgr / op_que.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  2.6 KB  |  117 lines

  1. /* op_que.c: que ROS operation routines */
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Lib/qmgr/RCS/op_que.c,v 6.0 1991/12/18 20:23:58 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Lib/qmgr/RCS/op_que.c,v 6.0 1991/12/18 20:23:58 jpo Rel $
  9.  *
  10.  * $Log: op_que.c,v $
  11.  * Revision 6.0  1991/12/18  20:23:58  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16. #include "util.h"
  17. #include "consblk.h"
  18. #include "qmgr-int.h"
  19. #include "Qmgr-types.h"
  20. #include <isode/cmd_srch.h>
  21. #include <isode/rosap.h>
  22.  
  23. static CMD_TABLE ops_tbl[] = {
  24.     QCTRL_ABORT,    int_Qmgr_QMGROp_abort,
  25.     QCTRL_GRACEFUL,    int_Qmgr_QMGROp_gracefulTerminate,
  26.     QCTRL_RESTART,    int_Qmgr_QMGROp_restart,
  27.     QCTRL_REREAD,    int_Qmgr_QMGROp_rereadQueue,
  28.     QCTRL_DISSUB,    int_Qmgr_QMGROp_disableSubmission,
  29.     QCTRL_ENASUB,    int_Qmgr_QMGROp_enableSubmission,
  30.     QCTRL_DISALL,    int_Qmgr_QMGROp_disableAll,
  31.     QCTRL_ENAALL,    int_Qmgr_QMGROp_enableAll,
  32.     QCTRL_INCMAX,    int_Qmgr_QMGROp_increasemaxchans,
  33.     QCTRL_DECMAX,    int_Qmgr_QMGROp_decreasemaxchans,
  34.     NULLCP,        NOTOK
  35. };
  36.  
  37. /* ARGSUSED */
  38. int arg_quecontrol (ad, args, arg)
  39. int    ad;
  40. char    **args;
  41. struct type_Qmgr_QMGROp **arg;
  42. {
  43.     *arg = (struct type_Qmgr_QMGROp *) malloc(sizeof(**arg));
  44.     (*arg)->parm = cmd_srch(args[0], ops_tbl);
  45.     if ((*arg) -> parm == NOTOK)
  46.         return NOTOK;
  47.     return OK;
  48. }
  49.  
  50. /* ARGSUSED */
  51. int res_quecontrol (ad, id, dummy, result, roi)
  52. int    ad,
  53.     id,
  54.     dummy;
  55. struct type_Qmgr_Pseudo__qmgrControl    *result;
  56. struct RoSAPindication            *roi;
  57. {
  58.     return OK;
  59. }
  60.  
  61. /*   */
  62.  
  63. static QmgrStatus *convert_QmgrStatus();
  64.  
  65. /* ARGSUSED */
  66. int res_qmgrStatus (ad, id, dummy, result, roi)
  67. int    ad,
  68.     id,
  69.     dummy;
  70. struct type_Qmgr_QmgrStatus    *result;
  71. struct RoSAPindication    *roi;
  72. {
  73.     struct cons_opblk *op;
  74.  
  75.     if ((op = find_copblk(ad, id)) == NULL)
  76.         return NOTOK;
  77.     
  78.     if (op -> fnx)
  79.         (*op -> fnx) (convert_QmgrStatus(result), id);
  80.     free_copblk (op);
  81.     return OK;
  82. }
  83.  
  84. /*   */
  85.  
  86. static QmgrStatus *convert_QmgrStatus(pepsy)
  87. struct type_Qmgr_QmgrStatus    *pepsy;
  88. {
  89.     QmgrStatus    *ret;
  90.  
  91.     if ((struct type_Qmgr_QmgrStatus *) NULL == pepsy)
  92.         return (QmgrStatus *) NULL;
  93.  
  94.     ret = (QmgrStatus *) malloc(sizeof(*ret));
  95.  
  96.     if (pepsy->boottime)
  97.         ret->boottime = convert_time(pepsy->boottime);
  98.     else
  99.         ret->boottime = 0;
  100.  
  101.     ret->messagesIn = pepsy->messagesIn;
  102.     ret->messagesOut = pepsy->messagesOut;
  103.     ret->addrIn = pepsy->addrIn;
  104.     ret->addrOut = pepsy->addrOut;
  105.     ret->opsPerSec = pepsy->opsPerSec;
  106.     ret->runnableChans = pepsy->runnableChans;
  107.     ret->msgsInPerSec = pepsy->msgsInPerSec;
  108.     ret->msgsOutPerSec = pepsy->msgsOutPerSec;
  109.     ret->maxChans = pepsy->maxChans;
  110.     ret->currChans = pepsy->currChans;
  111.     ret->totalMsgs = pepsy->totalMsgs;
  112.     ret->totalVolume = pepsy->totalVolume;
  113.     ret->totalDRs = pepsy->totalDrs;
  114.  
  115.     return ret;
  116. }
  117.